<template>
	<view class="page-wrap" :data-theme="theme" :style="globalColor.style">
		<header-custom title="新高考选科" />
		<u-sticky bgColor="#fff">
		<u-tabs :current="tabIndex" :list="tabList" @click="onTabChange" lineColor="#00C15D"
			:scrollable="false"></u-tabs>
		</u-sticky>
		<view class="list" v-for="(item, index) in analyzeList" :key="index">
			<view class="space-block"></view>
			<view class="item-analyze" :style="`border-color:${colorList[index % 5]}`">
				<view class="hd fboxRow font36 w690">
					<view class="fboxRow Ycenter flex1 tit font26 color-36363A">
						<view class="dot" :style="`background:${colorList[index % 5]}`"></view>
						{{item.combName}}
					</view>
					<view class="fboxRow Ycenter right font22" :style="`color:${colorList[index % 5]}`"
						@tap="tipsClick">
						<!-- {{item.combEvaluate || '相当不错'}} -->
						参考数据
						<text class="bksCIcon bks-c-ziyuan39jieshi font24"></text>
					</view>
				</view>
				<view class="bd fboxRow w690">
					<view class="fboxCol Ycenter Xcenter flex1">
						<view class="number fboxRow Yend font24 color-6A6A6F" @tap="pageTo(item.combId,'major')">
							<text class="num font48" :style="`color:${colorList[index % 5]}`">{{item.majorNum}}</text>个
						</view>
						<view class="spice"></view>
						<view class="tips fboxRow  Ycenter font20 color-36363A"> 这些专业可以选</view>
					</view>
					<view class="fboxCol Ycenter Xcenter flex1">
						<view class="number fboxRow Yend font24 color-6A6A6F" @tap="pageTo(item.combId,'school')">
							<text class="num font48 color-36363A">{{item.schoolNum}}</text>所
						</view>
						<view class="spice"></view>
						<view class="tips fboxRow  Ycenter font20 color-36363A"> 这些院校可以选</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import headerCustom from '@/pagesBKS/components/header-custom.vue';
	import { analysisList } from '@/api/bks.examinee.js'
	export default {
		components: {
			headerCustom
		},
		data() {
			return {
				theme: 'bks-theme',
				globalColor: getApp().globalData.globalColor,
				tabIndex: 0,
				tabList: [{
					name: '本科',
					key: "1"
				}, {
					name: '专科',
					key: "2"
				}],
				analyzeList: [
					// {combId: "XKZH0002", combName: "物理 化学 思政", schoolNum: 1692, majorNum: 1504, isFavorite: true}
				],
				colorList: ['#FF9645', '#00C15D', '#FFBC44', '#3480FF', '#E85531'],
			}
		},
		onLoad(options) {
			this._analysis()
		},
		methods: {
			// 选科分析
			_analysis() {
				analysisList({
					schoolType: this.tabList[this.tabIndex].key
				}).then(res => {
					res.data.filter(item => {
						const num = item.majorNum + item.schoolNum
						item.dx = (Math.round(item.schoolNum / num * 10000) / 100.00)
						item.zy = (Math.round(item.majorNum / num * 10000) / 100.00)
					})
					this.analyzeList = res.data
				})
			},
			pageTo(id, tag) {
				this.$pageTo('/bks/index/analyze/list/index', {
					id,
					activeTab: this.tabList[this.tabIndex].key,
					tag
				})
			},
			onTabChange(e) {
				this.tabIndex = e.index
				this._analysis()
			},
			onReachBottom: function() {
				this._analysis()
			},
			// 提示
			tipsClick() {
				uni.showModal({
					showCancel: false,
					confirmColor: '#00C15D',
					content: '本数据来源于重庆市教育考试院发布的《2021年拟在渝招生普通高校招生专业(类)选考科目要求(3+1+2模式)_本科》、《2021年拟在渝招生普通高校招生专业(类)选考科目要求(3+1+2模式)_专科》通知的数据统计，具体请参考对应的考试院通知文件。'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.item-analyze{padding: 0 30rpx; border-top: 3rpx solid #000;}
	.hd{height: 88rpx; border-bottom: 1rpx dashed #EBEBF0;}
	.dot{margin-right: 10rpx; width: 12rpx;height: 12rpx;background: #FF9645;border-radius: 50%;}
	.bks-c-ziyuan39jieshi{margin-left: 10rpx;}
	.bd{height: 230rpx;}
	
	.number{height: 60rpx;z-index: 1;}
	.num{margin-right: 10rpx;}
	.tips{height: 60rpx;}
	.spice{width: 32rpx;height: 1rpx;background: #E1E1E6;border-radius: 1rpx;}
</style>